/**
 * @Question test
 * @Date 2022/10/21 10:53
 * @Solution
 */
class IllegalNumberException extends Exception{
    private String message;
    public IllegalNumberException (String message) {
        super(message);
        this.message=message;
    }
}
class Use {
    int a,b,c;
    public Use(int a,int b,int c) {
        this.a=a;
        this.b=b;
        this.c=c;
    }
    public void calArea() throws Exception {
        if(a+b<=c || a+c<=b || b+c<=a) {
            throw new IllegalNumberException("无法构成三角形");
        }
        int p=(a+b+c)/2;
        System.out.println(Math.sqrt(p*(p-a)*(p-b)*(p-c)));
    }
}
public class test {
    public static void main(String[] args) {
        try {
            int[] arr = new int[5];
            System.out.println(arr[5]);
        } catch (Exception e) {
            System.out.println("数组越界异常");
        }
        try {
            System.out.println(1 / 0);
        } catch (Exception e) {
            System.out.println("算数错误");
        }

        int a = 3;
        int b = 4;
        int c = 5;
        Use use = new Use(a, b, c);
        try {
            use.calArea();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return;
        }
        System.out.println("正常");
    }
}
